//
//  LHNavigationController.m
//  LazyHome
//
//  Created by yh on 2018/5/18.
//  Copyright © 2018年 yh. All rights reserved.
//

#import "LHNavigationController.h"
#import "ServerTCPManager.h"

@interface LHNavigationController ()

@end

@implementation LHNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
//    self.view.frame = CGRectMake(0, 0, 200, 200);
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusChange) name:SERVER_CONNECT_STATUS_CHANGE object:nil];
    [self statusChange];
   
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (void)statusChange{
     self.navigationBar.backgroundColor = [ServerTCPManager shareManager].client.tcpClientStatus == TCPClientStatusConnected ?  [UIColor greenColor] : [UIColor redColor];
}


//- (void)viewWillLayoutSubviews
//{
//    self.view.frame = CGRectMake(0, 0, 50, 50);
//}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
